<span class="separator"></span>
<div id="main-heading">
	<div class="columns">
		<div class="two-third">
			<h2><?php echo $blogpage['title']; ?></h2>
			<ul id="breadcrumb">
				<li><a href="<?php echo $this->baseUrl("/");?>">Home</a> &raquo;
					<ul>
						<li><a href="#">Blog</a></li>
					</ul>
				</li>
			</ul>							
			<!-- breadcrumb - end -->									
		</div>
		<div class="third">
				<div class="addthis">
					<!-- AddThis Button BEGIN -->
					<div class="addthis_toolbox addthis_default_style ">
					<a href="http://www.addthis.com/bookmark.php?v=250&amp;username=xa-4ce5339244cec0d5" class="addthis_button_compact">Share</a>
					<span class="addthis_separator">|</span>
					<a class="addthis_button_preferred_1"></a>
					<a class="addthis_button_preferred_2"></a>
					<a class="addthis_button_preferred_3"></a>
					<a class="addthis_button_preferred_4"></a>
					</div>
					<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4ce5339244cec0d5"></script>
					<!-- AddThis Button END -->

				</div>
		</div>
	</div>
</div>
<span class="separator"></span><!-- main-heading - end -->	
			
<div class="main right">
	<?php if($action == 'bypost'):?>
	
		<h3><?php echo($post['title']);?></h3>
		<?php App::Hook('UI')->Render('blog_before_post'); #User Interface Hook ?>
		<?php echo($post['description']);?>
		<?php App::Hook('UI')->Render('blog_after_post'); #User Interface Hook ?>
		
	<?php else:?>
		<ul class="news compact">
		<?php if(!empty($blogpost['data'])):?>
			<?php foreach($blogpost['data'] as $post):?>
				<li>
					<div class="header">
						<div class="columns">
							
							<div class="two-third">
								<h2>
									<a href="<?php echo $this->baseurl("/blog-by-post/{$post['id']}/" . App::Helper('Utility')->text2Normalize($post['title'])); ?>"><?php echo($post['title']);?></a>
								</h2>
								<dl class="meta">
									<dt class="category">Categories</dt>
									<?php $catname = App::CategorySet()->idToName($post['category']);?>
									<dd>
										<a href="<?php echo $this->baseurl("/blog-by-cat/{$post['category']}/" . App::Helper('Utility')->text2Normalize($catname)); ?>"><?php echo $catname;?></a>
									</dd>
									<dt class="tags">User Difficulties</dt>
									<dd><a href="#">Beginner</a></dd>
									</dl>
								<p class="intro">
									<?php App::Hook('UI')->Render('blog_before_comment'); #User Interface Hook ?>
									<?php echo($post['description']);?>
									<?php App::Hook('UI')->Render('blog_after_comment'); #User Interface Hook ?>
								</p>
							</div>
						</div>
					</div>
				<a href="#header" class="separator"><span>Top</span></a>
				</li>
			<?php endforeach;?>
		<?php else:?>
			<h2><?php echo $this->__("Sorry! No post submitted yet"); ?></h2>
			<?php App::Hook('UI')->Render('blog_no_comment'); #User Interface Hook ?>
		<?php endif;?>
		</ul>
       
		<!--<ul class="pagination">
			<li class="prev"><a href="#prev">&lt;</a></li>
			<li>
				<ul class="pages">
					<li class="current"><a href="#">1</a></li>
					<li><a href="#">2</a></li>
					<li><a href="#">3</a></li>
			
					</ul>
			</li>
			<li class="next"><a href="#next">&gt;</a></li>
		</ul> -->
		<?php if($blogpost['paging']!=''):?>
			<p><?php echo $blogpost['link']; ?></p>
		<?php endif;?>
		
	<?php endif ?>

</div>


<div class="sidebar left">
	<?php App::Hook('UI')->Render('template_left_column_A'); #User Interface Hook ?>
	<h3><?php echo $this->__('Blog Category');?></h3>
	<?php $catdata = App::CategorySet('blog-cat')->findAll("1 ORDER BY title asc");?>
	
	<ul class="menu-1">
	<?php foreach($catdata['data'] as $val):?>
		<li>
			<a href="<?php echo $this->baseUrl("/blog-by-cat/{$val['id']}/" . App::Helper("Utility")->text2Normalize($val['title'])) ?>">
				<?php echo $val['title']; ?>
			</a>
		</li>
	<?php endforeach;?>									
	</ul>
	<!-- .menu-1 - end -->
	<?php App::Hook('UI')->Render('template_left_column_B'); #User Interface Hook ?>
	<?php App::Hook('UI')->Render('template_left_column_C'); #User Interface Hook ?>
	<?php App::Hook('UI')->Render('template_left_column_D'); #User Interface Hook ?>

	<?php  echo $this->callElement("default/common/testimonial"); ?>
		
</div>
